<?php
class ApiCenter_SalesApi_Model_Acl_Filter extends Mage_Api2_Model_Acl_Filter{
    /**
     * Return only the data which keys are allowed
     *
     * @param array $allowedAttributes List of attributes available to use
     * @param array $data Associative array attribute to value
     * @return array
     */
    protected function _filter($allowedAttributes, array $data)
    {
        foreach ($data as $attribute => $value) {
            if(is_array($value)){
                continue;
            }
            if (!in_array($attribute, $allowedAttributes)) {
                unset($data[$attribute]);
            }
        }
        return $data;
    }
    
    /**
     * Strip attributes out of collection items
     *
     * @param array $items
     * @return array
     */
    public function collectionOut($items)
    {
    
        foreach ($items as &$data) {
            if(!is_array($data)){
                continue;
            }
            $data = $this->out($data);
        }
        return $items;
    }
    
}